/*
 * @Author: sxb
 * @Email: sxb@mail.com
 * @Date: 2020-05-27 15:35:39
 * @Descripttion: 企业基本信息管理
 */ 
import request from '@/utils/request'

export function apiGetDeptExt(data) {
    if(data !== undefined && data !== null){
        data.page = data.page < 0 ? 0 : data.page - 1
    }
    return new Promise((resolve, reject) => {
        request.get('api/deptExt',{params:data}).then(res => {
            resolve(res);
        }).catch(error => {
            reject(error)
        })
    })
}

export function apiGetDeptExtFindByDeptId(deptId) {
    return new Promise((resolve, reject) => {
        request.get('api/deptExt/findbydeptid?deptId=' + deptId,{}).then(res => {
            resolve(res);
        }).catch(error => {
            reject(error)
        })
    })
}

export function apiGetDeptExtFindAll() {
    return new Promise((resolve, reject) => {
        request.get('api/deptExt/findAll',{}).then(res => {
            resolve(res);
        }).catch(error => {
            reject(error)
        })
    })
}

export function apiPostDeptExt(data){
    return new Promise((resolve, reject) => {
        request.post('api/deptExt', data).then(res => {
            resolve(res);
        }).catch(error => {
            reject(error)
        })
    })
}

export function apiPutDeptExt(data){
    return new Promise((resolve, reject) => {
        request.put('api/deptExt', data).then(res => {
            resolve(res);
        }).catch(error => {
            reject(error)
        })
    })
}

export function apiDelDeptExt(data){
    return new Promise((resolve, reject) => {
        request.delete('api/deptExt', {data:data}).then(res => {
            resolve(res);
        }).catch(error => {
            reject(error)
        })
    })
}

export function apiUploadFileDeptExt(data){
    return new Promise((resolve, reject) => {
        request.post('api/deptExt/updateFile', data).then(res => {
            resolve(res);
        }).catch(error => {
            reject(error)
        })
    })
}

export function apiPostDeptExtRegister(data){
    return new Promise((resolve, reject) => {
        request.post('api/deptExt/register', data).then(res => {
            resolve(res);
        }).catch(error => {
            reject(error)
        })
    })
}

